<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <%@ include file="/common/meta.jsp" %>
 	 <%@ include file="/common/import.jsp"%>
    <title>会员列表页面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
		#userRegTable,#editTable
		  {
		  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
		  width:50%;
		  border-collapse:collapse;
		  }
		
		#userRegTable td,#editTable td, #customers th,#editTable th 
		  {
		  font-size:1em;
		  border:1px solid #98bf21;
		  padding:3px 7px 2px 7px;
		  }
		
		#userRegTable th,#editTable th
		  {
		  font-size:1.1em;
		  text-align:left;
		  padding-top:5px;
		  padding-bottom:4px;
		  background-color:#A7C942;
		  color:#ffffff;
		  }
		
		 .alt
		  {
		  color:#000000;
		  background-color:#EAF2D3;
		  }
	</style>
	</script>
	<script type="text/javascript">
		$(function(){
			
			
			var num = '${param.num}';
			var url = "${ctx}/audit/getAuditList.action?auditType=addMember&tableName=T_MEMBER&colName=MEMBER_ID";
			if(num!=null&&num!=""){
				url=url+"&num="+num;
			}
			
					
			$('#dataCateList').datagrid({
				title:'申请认证会员列表',
				iconCls:'icon-ok',
				url:"${ctx}/audit/getAuditList.action?auditType=addMember&tableName=t_member&colName=MEMBER_ID",
				nowrap: false,
				striped: true,
				collapsible:false,				
				fitColumns: true,
				pagination:true,
				singleSelect:true,
				rownumbers:true,
				remoteSort: false,
				pageList:[15,20,30,50],
				idField:'memberId',
				columns:[[
					{field:'MEMBER_ENAME',title:'会员名称',width:50},
					{field:'MEMBER_CNAME',title:'会员全称',width:50},
					{field:'SHORT_NAME',title:'会员简称',width:50},
					{field:'MEMBER_TYPE',title:'会员属性',width:50,
						formatter:function(value){
							if( value == '0'){return '个人';}
							else{ return '机构';}
						}
					},{field:'MEMBER_LEVEL',title:'会员级别',width:50,
						formatter:function(value){
							if( value == '1'){return '普通会员';}
							else if(value == '2'){return '认证会员';}
							else if(value == '3'){return '正式会员';}
							else{ return '未定级';}
						}
					},
					{field:'NUM',title:'审核阶段',width:50,
						formatter : function(value) {
							var info = value+"审";
							return info;
						}
					},
					{field:'op',title:'操作',width:70,
						formatter : function(value, member) {
							var info = "";
							if(member.NUM == '1'){
								info += "<a href=\"javascript:void(0)\" onclick=\"editCate('"
									+ member.MEMBER_ID+"'"+","+"'"+member.AUDIT_ID+"',"+"'2','90','"+member.NUM
									+ "')\" style=\"color: blue\" >开始审核</a> ";
							}
							if(member.NUM == '2'){
								info += "<a href=\"javascript:void(0)\" onclick=\"editCate('"
									+ member.MEMBER_ID+"'"+","+"'"+member.AUDIT_ID+"',"+"'1','91"
									+ "')\" style=\"color: blue\" >开始审核</a> ";
							}
							return info;
						}
					}
				]],
				toolbar:[{
					text:'刷新',
					iconCls:'icon-reload',
					handler:function(){
						$('#dataCateList').datagrid('reload');
					}
				}
				]
			});		
		});
		//查看不通过原因
		function showOpinion(pid){
			window.location.href = "${ctx}/baseController/member/audit/member-audit-msg?pid=" + pid +"&status=90&num=2";	
		}
		// 查找
		function searchCate(){
			var queryParams = $('#dataCateList').datagrid('options').queryParams;
			var opt = $('#dataCateList').datagrid('options');
			$('#dataCateList').datagrid('options').pageNumber = 1;
			queryParams["memberEname"] = $('#memberEname').val();
			queryParams["memberCname"] = $('#memberCname').val();
			queryParams["shortName"] = $('#shortName').val();
			var page = $('#dataCateList').datagrid('getPager');
			page.pagination({
				pageNumber : 1,
				pageSize : opt.pageSize
			});
			$('#dataCateList').datagrid('reload');
		}
		
		
		// 刷新列表
		function cateReload(){
			$('#dataCateList').datagrid('reload');
		}
		
		 //关闭win
		 function closeWin(){
		 	$('#saveDiv').window('close');	
		 }	 
		
		// 进入认证申请页面
		function editCate(memberId,auditId,num,status, nowNum){
			window.location.href = "${ctx}/sendPage/member/audit/audit-addMember?memberId=" + memberId+"&auditId="+auditId+"&pid="+memberId+"&status="+status+"&num="+num+"&nowNum="+nowNum;	
		}
		
	</script>

  </head>
  <body>
  	 <!-- 查询窗口 -->
	<div id="query" class="easyui-window" title="查询" style="padding:5px;width:400px;height:250;"
    	iconCls="icon-search" closed="true" maximizable="false" minimizable="false" collapsible="false">
		<table class="datagrid-body" >
			<tr>	
				<td class="datagrid-header">用户账号：</td>
				<td><input type="text" id="memberEname" name="memberEname" size="30" value="" /></td>
			</tr>
			
			<tr >
				<td class="datagrid-header">用户名称：</td>
				<td><input type="text" id="memberCname" name="memberCname" size="30" value="" /></td>
			</tr>

			<tr >
				<td class="datagrid-header">用户简称：</td>
				<td><input type="text" id="shortName" name="shortName" size="30" value="" /></td>
			</tr>
			<tr>	
				<td class="datagrid-header"></td>
				<td><a href="#" class="easyui-linkbutton" iconCls="icon-search" onClick="searchCate();">查找</a></td>	
			</tr>
		</table>
     </div>
     <!-- 修改窗口 -->
 	 <div id="saveDiv" class="easyui-window" title="修改会员" style="padding:5px;width: 700px;height:450px;"
    	iconCls="icon-search" closed="true" maximizable="false" minimizable="false" collapsible="false">
   		<iframe frameborder="0"  id="saveFrame" height="100%" width="100%" scrolling="auto" frameborder="0" ></iframe>
     </div>
     <table id="dataCateList"></table>

     
 	 <div id="saveVisitRecordDiv" class="easyui-window" title="新增回访记录" style="padding:5px;width: 350px;height:450px;"
    	iconCls="icon-search" closed="true" maximizable="false" minimizable="false" collapsible="false">
   		<iframe frameborder="0"  id="saveVisitRecordFrame" height="100%" width="100%" scrolling="auto" frameborder="0" >
   		</iframe>
     </div>
    

  </body>
</html>
